package com.qualiti.javaweb.modelo;

import java.io.Serializable;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

public class Categoria implements Serializable{
	private String nome;
	
	public Categoria(String nome) {
		this.nome = nome;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}
	
	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(nome).toHashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		return new EqualsBuilder().append(nome, ((Categoria) obj).getNome()).isEquals();
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this).append("nome", nome).toString();
	}
}
